package com.xingkeduo.business.user.service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Description:
 * @Author:gaozifeng
 * @Date 2019/3/2 10:48
 **/
@Component
public class RabbitTopicSenderService {

    private static final Logger logger = LoggerFactory.getLogger(RabbitTopicSenderService.class);

    @Autowired
    private AmqpTemplate template;

    public void topicSend(String msg){
        //像交换机topicExchange上面 发送 消息 符合topic.message  这条 也会符合 topic.#
        template.convertSendAndReceive("topicExchange", "topic.aaaa", "hello this is message!");
//        System.out.println("??????????topic Receiver:"+topicExchange.toString());
    }
}
